/**
 * 
 */
package com.ac4j.algorithm;

import java.util.ArrayList;

import com.ac4j.match.Match;
import com.ac4j.sample.Sample;
import com.ac4j.sample.SampleImage;

/**
 * @author Administrator
 * 
 */
public abstract class AbstractStrategy {
	AbstractLocatingAlgorithm locatingalgorithm;
	AbstractRecognitionAlgorithm recognitionalgorithm;

	SampleImage sourceimage;
	ArrayList<Sample> prototypesamples;

	/**
	 * @return the matchlist
	 */
	public abstract ArrayList<Match> Execute();

	/**
	 * @return the locatingalgorithm
	 */
	public AbstractLocatingAlgorithm getLocatingalgorithm() {
		return locatingalgorithm;
	}

	/**
	 * @return the recognitionalgorithm
	 */
	public AbstractRecognitionAlgorithm getRecognitionalgorithm() {
		return recognitionalgorithm;
	}

	/**
	 * @return the sourceimage
	 */
	public SampleImage getSourceimage() {
		return sourceimage;
	}

	/**
	 * @return the prototypesamples
	 */
	public ArrayList<Sample> getPrototypesamples() {
		return prototypesamples;
	}

	/**
	 * @param locatingalgorithm
	 * @param recognitionalgorithm
	 * @param sourceimage
	 * @param prototypesamples
	 */
	public AbstractStrategy(AbstractLocatingAlgorithm locatingalgorithm,
			AbstractRecognitionAlgorithm recognitionalgorithm,
			SampleImage sourceimage, ArrayList<Sample> prototypesamples) {
		if (sourceimage == null || prototypesamples == null)
			throw new IllegalArgumentException(
					"Null sourceimage or prototypesamples is illegal for strategy!");

		this.locatingalgorithm = locatingalgorithm;

		this.recognitionalgorithm = recognitionalgorithm;
		this.sourceimage = sourceimage;
		this.prototypesamples = prototypesamples;
	}

}
